package com.example.health.cooking;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.health.HomeMenuActivity;
import com.example.health.R;
import com.example.health.food_list.InfoListActivity;

public class Cook extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cook);
    }

    @Override
    public void onClick(View v) {
        int height01=700;
        int height02=150;
        Button btncook1 = findViewById(R.id.btn_cook1);
        Button btncook2 = findViewById(R.id.btn_cook2);
        Button btncook3 = findViewById(R.id.btn_cook3);
        Button btncook4 = findViewById(R.id.btn_cook4);
        Button btncook5 = findViewById(R.id.btn_cook5);
        Button btncook6 = findViewById(R.id.btn_cook6);
        Button btncook7 = findViewById(R.id.btn_cook7);
        Button btncook8 = findViewById(R.id.btn_cook8);
        Button btncook9 = findViewById(R.id.btn_cook9);
        Button btncook10 = findViewById(R.id.btn_cook10);
        Button btncook11 = findViewById(R.id.btn_cook11);
        Button btncook12 = findViewById(R.id.btn_cook12);
        Button btncook13 = findViewById(R.id.btn_cook13);
        Button btncook14 = findViewById(R.id.btn_cook14);
        Button btncook15 = findViewById(R.id.btn_cook15);
        Button btncook16 = findViewById(R.id.btn_cook16);
        Button btncook17 = findViewById(R.id.btn_cook17);
        Button btncook18 = findViewById(R.id.btn_cook18);
        Button btncook19 = findViewById(R.id.btn_cook19);
        ViewGroup.LayoutParams params1 = btncook1.getLayoutParams();
        ViewGroup.LayoutParams params2 = btncook2.getLayoutParams();
        ViewGroup.LayoutParams params3 = btncook3.getLayoutParams();
        ViewGroup.LayoutParams params4 = btncook4.getLayoutParams();
        ViewGroup.LayoutParams params5 = btncook5.getLayoutParams();
        ViewGroup.LayoutParams params6 = btncook6.getLayoutParams();
        ViewGroup.LayoutParams params7 = btncook7.getLayoutParams();
        ViewGroup.LayoutParams params8 = btncook8.getLayoutParams();
        ViewGroup.LayoutParams params9 = btncook9.getLayoutParams();
        ViewGroup.LayoutParams params10 = btncook10.getLayoutParams();
        ViewGroup.LayoutParams params11 = btncook11.getLayoutParams();
        ViewGroup.LayoutParams params12 = btncook12.getLayoutParams();
        ViewGroup.LayoutParams params13 = btncook13.getLayoutParams();
        ViewGroup.LayoutParams params14 = btncook14.getLayoutParams();
        ViewGroup.LayoutParams params15 = btncook15.getLayoutParams();
        ViewGroup.LayoutParams params16 = btncook16.getLayoutParams();
        ViewGroup.LayoutParams params17 = btncook17.getLayoutParams();
        ViewGroup.LayoutParams params18 = btncook18.getLayoutParams();
        ViewGroup.LayoutParams params19 = btncook19.getLayoutParams();
        switch (v.getId()){
            case R.id.btn_cook1:
                params1.height = height01;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook2:
                params1.height = height02;
                params2.height = height01;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook3:
                params1.height = height02;
                params2.height = height02;
                params3.height = height01;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook4:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height01;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook5:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height01;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook6:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height01;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook7:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height01;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook8:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height01;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook9:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height01;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook10:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height01;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook11:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height01;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook12:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height01;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook13:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height01;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook14:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height01;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook15:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height01;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook16:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height01;
                params17.height = height02;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook17:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height01;
                params18.height = height02;
                params19.height = height02;
                break;
            case R.id.btn_cook18:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height01;
                params19.height = height02;
                break;
            case R.id.btn_cook19:
                params1.height = height02;
                params2.height = height02;
                params3.height = height02;
                params4.height = height02;
                params5.height = height02;
                params6.height = height02;
                params7.height = height02;
                params8.height = height02;
                params9.height = height02;
                params10.height = height02;
                params11.height = height02;
                params12.height = height02;
                params13.height = height02;
                params14.height = height02;
                params15.height = height02;
                params16.height = height02;
                params17.height = height02;
                params18.height = height02;
                params19.height = height01;
                break;
                default:
                    break;
        }
        btncook1.setLayoutParams(params1);
        btncook2.setLayoutParams(params2);
        btncook3.setLayoutParams(params3);
        btncook4.setLayoutParams(params4);
        btncook5.setLayoutParams(params5);
        btncook6.setLayoutParams(params6);
        btncook7.setLayoutParams(params7);
        btncook8.setLayoutParams(params8);
        btncook9.setLayoutParams(params9);
        btncook10.setLayoutParams(params10);
        btncook11.setLayoutParams(params11);
        btncook12.setLayoutParams(params12);
        btncook13.setLayoutParams(params13);
        btncook14.setLayoutParams(params14);
        btncook15.setLayoutParams(params15);
        btncook16.setLayoutParams(params16);
        btncook17.setLayoutParams(params17);
        btncook18.setLayoutParams(params18);
        btncook19.setLayoutParams(params19);

    }
}
